Imports System.Collections
Imports System.Globalization
Imports System.Text.RegularExpressions
Public Module FuncionesVarias
    Public Function stringFecha(ByVal fecha As String) As DateTime
        Dim formatoFecha As New System.Globalization.DateTimeFormatInfo()
        formatoFecha.ShortDatePattern = "dd/MM/yyyy"
        Return DateTime.Parse(fecha, formatoFecha)
    End Function
    Public Function stringFecha(ByVal fecha As String, ByVal formato As String) As DateTime
        Dim formatoFecha As New System.Globalization.DateTimeFormatInfo()
        formatoFecha.ShortDatePattern = formato
        Return DateTime.Parse(fecha, formatoFecha)
    End Function
    Public Function stripHTML(ByVal strHTML)
        'Strips the HTML tags from strHTML
        strHTML = strHTML.Replace("\r", " ")
        strHTML = strHTML.Replace("\n", " ")
        strHTML = strHTML.Replace("\t", String.Empty)
        Dim objRegExp As Regex, strOutput As String
        objRegExp = New Regex("<(.|\n)+?>")

        'objRegExp.IgnoreCase = True
        'objRegExp.Global = True
        'objRegExp.Pattern = "<(.|\n)+?>"

        'Replace all HTML tag matches with the empty string
        strOutput = objRegExp.Replace(strHTML, "")

        'Replace all < and > with &lt; and &gt;
        strOutput = Replace(strOutput, "<", "&lt;")
        strOutput = Replace(strOutput, ">", "&gt;")

        stripHTML = strOutput    'Return the value of strOutput

        objRegExp = Nothing
    End Function

End Module
